package org.desktop.web.client.customer.proxy;

import java.util.HashMap;
import java.util.Map;

import org.desktop.web.client.customer.CustomerService;
import org.desktop.web.client.customer.CustomerServiceAsync;
import org.desktop.web.shared.domain.entities.CustomersEnabled;

import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.data.client.loader.RpcProxy;
import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;
import com.sencha.gxt.widget.core.client.info.Info;

public class RpcCustomerProxy extends RpcProxy<FilterPagingLoadConfig, PagingLoadResult<CustomersEnabled>> {

	private CustomerServiceAsync service = GWT.create(CustomerService.class);
	@Override
	public void load(FilterPagingLoadConfig loadConfig,
			AsyncCallback<PagingLoadResult<CustomersEnabled>> callback) {
		Map<String, String> headers = new HashMap<String,String>();
		headers.put("token", Cookies.getCookie("token"));
		service.getCustomers(headers, loadConfig, callback);
	}

}
